import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from "@/views/LoginView.vue";
import DetailView from "@/views/mingxi/DetailView.vue";
import AccountView from "@/views/jizhang/AccountView.vue";
import MyInfoView from "@/views/myInfo/MyInfoView.vue";
import IndexView from "@/views/IndexView.vue";
import MyHuiZhangView from "@/views/myInfo/other/myHuiZhangView.vue";
import MessageView from "@/views/myInfo/other/MessageView.vue";
import SettingView from "@/views/myInfo/other/SettingView.vue";
import BudgetMainView from "@/views/yusuan/BudgetMainView.vue";
import MessageListView from "@/views/myInfo/other/MessageListView.vue";
import MyAsset from "@/views/myasset/MyAsset.vue";
import AssetAdd from "@/views/myasset/AssetAdd.vue";

Vue.use(VueRouter)
const originalPush = VueRouter.prototype.push
// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}


const routes = [
    {
        path: '/',
        name: 'login',
        component: LoginView
    }, {
        path: '/index',
        name: 'index',
        component: IndexView
    }, {
        path: '/detail',
        name: 'detail',
        component: DetailView
    }, {
        path: '/account',
        name: 'account',
        component: AccountView
    }, {
        path: '/myInfo',
        name: 'myInfo',
        component: MyInfoView
    },
    {
        path: '/myHuiZhang',
        name: 'myHuiZhang',
        component: MyHuiZhangView
    }, {
        path: '/messageDetail',
        name: 'messageDetail',
        component: MessageView
    }, {
        path: '/message',
        name: 'message',
        component: MessageListView
    },{
        path: '/Setting',
        name: 'setting',
        component: SettingView
    }, {
        path: '/Budget',
        name: 'budget',
        component: BudgetMainView
    }, {
        path: '/myAsset',
        name: 'MyAsset',
        component: MyAsset
    }, {
        path: '/assetAdd',
        name: 'AssetAdd',
        component: AssetAdd
    }

]

const router = new VueRouter({
    routes
})

export default router
